www.gusucode.com > 8:【198-3690】html5响应式网站织梦模板源码 IT网络工作室整站(自适应手机) > 8:【198-3690】html5响应式网站织梦模板源码 IT网络工作室整站(自适应手机)/skins/js/jsappbanner.js

    $(function(){
	/////////////banner效果//////////////
            var curshuxns = 0;
            var BnersetInterval;
            var mousemove = true;
			
            /////////向前滚动///////
            function Aforward() {
                clearInterval(setinxsd);
                $(".bannerItm img").stop().css("margin-left", "150%");
                var baneItmleng = $(".bannerItm img").length;
                $(".bannerItm img").eq(baneItmleng - 1).stop().css({ marginLeft: 0, marginTop: "-100%" });
                var asjishi = 0;
                var setinxsd = setInterval(function () {
                    $(".bannerItm img").each(function (index, element) {
                        if (index < baneItmleng - 1) {
                            $(this).animate({ marginLeft: 0 }, 300 + 200 * index, "easeInOutCubic");
                        }
                    });
                    asjishi++;
                    if (asjishi == 2) {
                        $(".bannerItm img").eq(baneItmleng - 1).animate({ marginTop: 0 }, 1000, "easeOutExpo", function () {
                            mousemove = true;
                        });
                        clearInterval(setinxsd);
                    }
                }, 500)

            }
			
			$(".SybannerL").click(function(){
				var zhisucs=curshuxns;
				if(zhisucs>0){
					zhisucs--;
				}else{
					zhisucs=$(".Sybannerli").length-1;
				}
				 bannerAnimatGD(zhisucs, false);
			})
			$(".SybannerR").click(function(){
				var zhisucs=curshuxns;
				if(zhisucs<$(".Sybannerli").length-1){
					zhisucs++;
				}else{
					zhisucs=0;
				}
				 bannerAnimatGD(zhisucs, false);
			})
	
			
			//////////banner手势///////////
			//$(".Sybanner")
			$touchEvent(".Sybanner",function(){
					$(".SybannerR").trigger("click");
				},function(){
					$(".SybannerL").trigger("click");
				},"","")
			//////////banner手势***///////////


            /////////向后滚动///////
            function Abackwards() {
                clearInterval(setinxsd);
                $(".bannerItm img").stop().css("margin-left", "-150%");
                var baneItmleng = $(".bannerItm img").length;
                $(".bannerItm img").eq(baneItmleng - 1).stop().css({ marginLeft: 0, marginTop: "-100%" });
                var asjishi = 0;
                var setinxsd = setInterval(function () {
                    $(".bannerItm img").each(function (index, element) {
                        if (index < baneItmleng - 1) {
                            $(this).animate({ marginLeft: 0 }, 300 + 200 * index, "easeInOutCubic");
                        }
                    });
                    asjishi++;
                    if (asjishi == 2) {
                        $(".bannerItm img").eq(baneItmleng - 1).animate({ marginTop: 0 }, 1000, "easeOutExpo", function () {
                            mousemove = true;
                        });
                        clearInterval(setinxsd);
                    }
                }, 500)
            }


            windorezise();
            $(".Sybanner p span").removeClass("curschsx").eq(curshuxns).addClass("curschsx");
            $(".Sybanner p span").click(function () {
                var indexcurem = $(".Sybanner p span").index(this);
                if (indexcurem != curshuxns) {
                    bannerAnimatGD(indexcurem, false);
                }
            })


            BnersetInterval = setInterval(BnersetInterHs, 10000);
            function BnersetInterHs() {
                if (curshuxns < $(".Sybanner p span").length - 1) {
                    bannerAnimatGD(curshuxns + 1, true);
                } else {
                    bannerAnimatGD(0, true);
                }
            }


           



            function windorezise() {
                $(".Sybannerli").stop().css({ left: $(window).width() });
                $(".Sybannerli").stop().eq(curshuxns).css({ left: 0 });
					//$(".ScrollSCS_NR3_PC").css("top",($(window).height()-$(".ScrollSCS_NR3_PC").height())/2+50);
            }
		
					
			
			
			
			

            function bannerAnimatGD(curnext, bo0l) {
                mousemove = false;
                var windowWdth = $(window).width();
                if (curnext > curshuxns || bo0l) {
                    $(".Sybannerli").eq(curshuxns).stop().css({ left: 0 }).animate({ left: -windowWdth }, 500, "easeInOutCubic");
                    $(".Sybannerli").eq(curnext).stop().css({ left: windowWdth }).animate({ left: 0 }, 500, "easeInOutCubic");
                    if (curnext == 0) {
                        Aforward();
                    }
                } else {
                    $(".Sybannerli").eq(curshuxns).stop().css({ left: 0 }).animate({ left: windowWdth }, 500, "easeInOutCubic");
                    $(".Sybannerli").eq(curnext).stop().css({ left: -windowWdth }).animate({ left: 0 }, 500, "easeInOutCubic");
                    if (curnext == 0) {
                        Abackwards();
                    }
                }
                curshuxns = curnext;
                $(".Sybanner p span").removeClass("curschsx").eq(curshuxns).addClass("curschsx");
                clearInterval(BnersetInterval);
                BnersetInterval = setInterval(BnersetInterHs, 10000);

            }


            $(window).resize(function () {
                windorezise();
            })
            /////////////banner效果***//////////////		
	
})